﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace AffordoPlugin.Helper
{
	public static class HttpHelper
	{
		public static Stream GetHttpStream(string url)
		{
			try
			{
				var http = new HttpClient();

				var rsp = http.GetAsync(url).Result;

				return rsp.Content.ReadAsStreamAsync().Result;
			}
			catch (Exception ex)
			{
				LogHelper.Error("GetHttpStream" + ex.Message + ex.InnerException?.Message ?? "");

				return null;
			}
		}
	}
}
